from core.mtoken import Token


class Expr:
    pass


class IF(Expr):
    def __init__(self, condition: Expr, consequence: Expr, alternative: Expr = None):
        self.condition = condition
        self.consequence = consequence
        self.alternative = alternative


class Literal(Expr):
    def __init__(self, value):
        self.value = value


class Variable(Expr):
    def __init__(self, name: Token):
        self.name = name


class Operator(Expr):
    def __init__(self, name: Token):
        self.operator = name


class Define(Expr):
    def __init__(self, arguments: list[Variable], body):
        self.arguments = arguments
        self.body = body

class DefineVar(Expr):
    def __init__(self, name: Token, value: Expr):
        self.name = name
        self.value = value

class DefineFunction(Expr):
    def __init__(self, name: Token, arguments: list[Variable], body):
        self.name = name
        self.arguments = arguments
        self.body = body

class Body(Expr):
    def __init__(self, defines: list[Define], expressions: list[Expr]):
        self.defines = defines
        self.expressions = expressions


class Application(Expr):
    def __init__(self, first: Expr, sequences: list[Expr]):
        self.first = first
        self.sequences = sequences
